package com.pd.backend.controller;

import com.pd.backend.dtos.AllocationCourier;
import com.pd.backend.dtos.PageResponseResult;
import com.pd.backend.dtos.ResponseResult;
import com.pd.backend.dtos.TaskPickupDto;
import com.pd.backend.service.PdTaskPickupDispatchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * 快递作业管理控制层
 */
@RestController
@RequestMapping("/ExpressageTask")
@Slf4j
@Api(tags = "快递作业管理")
public class PdTaskDispatchController {

    @Autowired
    private PdTaskPickupDispatchService pdTaskPickupDispatchService;

    /**
     * 分页查询取件作业
     * @param taskPickupDto
     * @return
     */
    @ApiOperation(value = "取派件作业分页查询")
    @PostMapping
    public PageResponseResult page(@RequestBody TaskPickupDto taskPickupDto){
       return pdTaskPickupDispatchService.page(taskPickupDto);
    }
    @ApiOperation(value = "分配快递员")
    @PostMapping("/allocationCourier")
    public ResponseResult allocationCourier(@RequestBody AllocationCourier allocationCourier){
        return pdTaskPickupDispatchService.allocationCourier(allocationCourier);
    }

}